package chp05;

public class Test8 {

    public static void main(String[] args) {
        //计算1+2+3+4+.....+100=?
        int num = 1;
        int sum = 0;
        while (num <= 100){
            sum += num;
            System.out.println(num);
            num++;
        }
        System.out.println("sum:"+sum);
    }
}
